package com.yadang.springcloud.controller;

import com.yadang.springcloud.entities.CommonResult;
import com.yadang.springcloud.entities.Payment;
import com.yadang.springcloud.service.PaymentFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author: 亚当
 * @date: 2022年09月07日 22:11
 * @package: com.yadang.springcloud.controller
 * @Description: TODO
 */
@RestController
@Slf4j
public class OrderFeignController {

    @Resource
    private PaymentFeignService paymentFeignService;

    @GetMapping("/consumer/payment/get/{id}")
    public CommonResult<Payment> getPaymentById(@PathVariable("id") Long id){
        CommonResult<Payment> paymentById = paymentFeignService.getPaymentById(id);
        return paymentById;
    }
    @GetMapping("/consumer/payment/feign/timeout")
    public String paymentFeignTimeOut(){
        String s = paymentFeignService.paymentFeignTimeOut();
        return s;
    }
}
